package com.mall.controller;

import com.mall.entity.Order;
import com.mall.entity.OrderItem;
import com.mall.entity.pojo.ResultBean;
import com.mall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    /**
     * 查询订单详情
     *
     * @param orderId
     * @return
     */
    @RequestMapping("/getDetail.do")
    @ResponseBody
    public List<OrderItem> getDetail(int orderId) {
        List<OrderItem> orderItems = orderService.findItems(orderId);
        return orderItems;
    }


}
